<?php
class ReceiptModel extends BaseModel
{
	var $table  = 'receipt';
	var $prikey = 'receipt_id';
	var $_name  = 'receipt';
	var $_relation = array(
		'belongs_factory' => array(
				'model' => 'factory_info',
				'type' => BELONGS_TO,
				'foreign_key' => 'factory_id',
				'reverse'       => 'has_receipt',
		),
		'belongs_order' => array(
				'model' => 'order',
				'type' => BELONGS_TO,
				'foreign_key' => 'order_id',
				'reverse'       => 'has_receipt',
		)
	);
}